!function($){"use strict";let wpcAjax=wpcFilterFront.wpcAjaxEnabled,wpcStatusCookieName=wpcFilterFront.wpcStatusCookieName,wpcMoreLessCookieName=wpcFilterFront.wpcMoreLessCookieName,wpcWidgetStatusCookieName=wpcFilterFront.wpcWidgetStatusCookieName,wpcHierachyListCookieName=wpcFilterFront.wpcHierarchyListCookieName,wpcMobileWidth=wpcFilterFront.wpcMobileWidth,wpcPostContainers=wpcFilterFront.wpcPostContainers,wpcAutoScroll=wpcFilterFront.wpcAutoScroll,wpcAutoScrollOffset=wpcFilterFront.wpcAutoScrollOffset,wpcWaitCursor=wpcFilterFront.wpcWaitCursor,wpcPostsPerPage=wpcFilterFront.wpcPostsPerPage,wpcUseSelect2=wpcFilterFront.wpcUseSelect2,wpcPopupCompatMode=wpcFilterFront.wpcPopupCompatMode,wpcApplyButtonSets=wpcFilterFront.wpcApplyButtonSets,wpcQueryOnThePageSets=wpcFilterFront.wpcQueryOnThePageSets,noPostsContainerMsg=wpcFilterFront.wpcNoPostsContainerMsg,wpcWidgetContainer=".wpc-filters-main-wrap",wpcIsMobile=!1,toReplaceSEO=!0,prevState=!1,currentState=!1,seoRuleId;function removeElement(e){e.fadeTo(100,0,function(){e.slideUp(100,function(){e.remove()})})}function wpcInitiateAll(){$(".wpc-filter-range-form").each(function(e,t){$.fn.wpcInitSlider($(t))}),window.innerWidth<=wpcMobileWidth&&(wpcIsMobile=!0,"yes"===wpcFilterFront.showBottomWidget&&(wpcAjax=!0)),"yes"===wpcUseSelect2&&$(wpcWidgetContainer).each(function(e,t){let i="wpc-filter-set-"+$(t).data("set");wpcInitSelect2(i)}),$(".wpc-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200,keepAlive:!0,maxWidth:"220px"})}function wpcInitSelect2(e){if(void 0===$.fn.select2)return;let t=navigator.userAgent.toLowerCase().indexOf("android")>-1,i=0;t&&(i=1/0),$(".wpc-filters-widget-select").select2({dropdownCssClass:"wpc-filter-everything-dropdown",dropdownParent:$("."+e+" .wpc-filters-widget-content"),templateResult:function(e){return wpcSelect2Template(e)},templateSelection:function(e){return wpcSelect2Template(e)},minimumResultsForSearch:i}),$(".wpc-orderby-select").select2({dropdownCssClass:"wpc-filter-everything-dropdown",dropdownParent:$(".wpc-after-sorting-form"),templateResult:function(e){if(!e.element)return e.text;let t=$(e.element),i=$("<span></span>");return i.addClass(t[0].className),i.text(e.text),i},minimumResultsForSearch:1/0})}function wpcSelect2Template(e){if(!e.element)return e.text;let t=$(e.element).data("image"),i=$(e.element).data("brand"),s=$(e.element).data("color"),n=e.text,a=$(e.element).data("count"),l="";if(void 0!==t)l="wpc-item-has-swatch",n=$('<span class="wpc-term-swatch-wrapper wpc-term-swatch-image"><img src="'+t+'" class="wpc-term-image" /></span><span class="wpc-term-name">'+e.text+"</span>");else if(void 0!==s){l="wpc-item-has-swatch";let r='<span class="wpc-term-swatch-wrapper">';"none"===s?r+='<span class="wpc-term-swatch wpc-no-swatch-yet">':r+='<span class="wpc-term-swatch" style="background-color:'+s+'">',r+='</span></span><span class="wpc-term-name">'+e.text+"</span>",n=$(r)}else void 0!==i&&(l="wpc-item-has-brand",n=$('<span class="wpc-term-image-wrapper"><img src="'+i+'"/></span><span class="wpc-term-name">'+e.text+"</span>"));let c=$(e.element),o=$("<span></span>");return o.addClass(c[0].className),""!==l&&o.addClass(l),o.html(n),void 0!==a&&o.append('<span class="wpc-term-count">(<span class="wpc-term-count-value">'+a+"</span>)</span>"),o}function wpcGetCookie(e){var t=document.cookie.match(RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0}function wpcSetCookie(e,t,i){let s=(i=i||{}).expires;if("number"==typeof s&&s){let n=new Date;n.setTime(n.getTime()+1e3*s),s=i.expires=n}s&&s.toUTCString&&(i.expires=s.toUTCString());let a=e+"="+(t=encodeURIComponent(t));for(let l in i){a+="; "+l;let r=i[l];!0!==r&&(a+="="+r)}document.cookie=a}function setStatusCookie(e,t){let i=wpcGetCookie(t),s=[];e=e.toString(),void 0===i?i="":s=(i=i.trim()).split(","),s=s.filter(function(e){return""!=e});let n=-e,a=s.indexOf(n.toString());if(-1!==a&&s.splice(a,1),-1===s.indexOf(e)){s.push(e);let l="";wpcSetCookie(t,l=0===s.length?e:s.join(),{path:"/","max-age":2592e3})}}function wpcCloseFiltersContainer(e){let t=$(".wpc-filter-set-"+e),i=$(".wpc-filter-set-"+e+" .wpc-filters-widget-content");$(".wpc-open-button-"+e+" .wpc-filters-open-widget").removeClass("wpc-opened"),$("html").removeClass("wpc-overlay-visible"),i.removeClass("wpc-filters-widget-opened"),wpcPopupCompatMode&&setTimeout(()=>{let e="",t=!1;i.parents().each(function(i,s){"undefined"!==(e=(t=$(s)).data("wpczindex"))&&t.css("z-index",e),t.hasClass("wpc-force-visibility")&&t.removeClass("wpc-force-visibility")}),setTimeout(()=>{$(".wpc-was-invisible").css("opacity","1").removeClass("wpc-was-invisible")},300)},260),t.removeClass("wpc-container-opened")}function wpcOpenFiltersContainer(e){let t=$(".wpc-filter-set-"+e),i=$(".wpc-filter-set-"+e+" .wpc-filters-widget-content"),s="",n="",a="",l=!1;if(i.length<1)return!0;wpcPopupCompatMode&&(i.parents().each(function(e,t){s=(l=$(t)).css("z-index"),n=l.is(":visible"),a=l.css("transform"),"auto"!==s&&l.data("wpczindex",s),l.css("z-index","auto"),n&&"none"===a||l.hasClass("widget_wpc_filters_widget")||l.hasClass("wpc-filters-main-wrap")||(l.css("opacity","0"),l.addClass("wpc-force-visibility wpc-was-invisible"))}),"yes"===wpcUseSelect2&&wpcInitSelect2("wpc-filter-set-"+e)),$(".wpc-open-button-"+e+" .wpc-filters-open-widget").addClass("wpc-opened"),$("html").addClass("wpc-overlay-visible"),$("body").data("set",e),i.addClass("wpc-filters-widget-opened"),t.addClass("wpc-container-opened"),$(".wpc-filter-set-"+e+" .wpc-filters-close-button").attr("href",window.location.href)}function wpcOpenContainer(e){let t=$(".wpc-filter-set-"+e);if(t.length<1){alert("There is no filter widget with ID "+e+" on this page");return}t.hasClass("wpc-container-opened")?wpcCloseFiltersContainer(e):wpcOpenFiltersContainer(e)}function wpcLockApplyButton(e){$(".wpc-filter-set-"+e).addClass("is-active"),$(".wpc-filter-set-"+e+" .wpc-filters-submit-button").addClass("on-hold"),$(".wpc-filter-set-"+e+" .wpc-filters-reset-button").addClass("on-hold")}function wpcUnlockApplyButton(e){$(".wpc-filter-set-"+e).removeClass("is-active"),$(".wpc-filter-set-"+e+" .wpc-filters-submit-button").removeClass("on-hold"),$(".wpc-filter-set-"+e+" .wpc-filters-reset-button").removeClass("on-hold")}function wpcShowSpinner(){$(".wpc-spinner, html").addClass("is-active")}function wpcHideSpinner(){$(".wpc-spinner, html").removeClass("is-active")}function submitSliderForm(e,t){if(e.originalEvent){let i=t.find(".wpc-filters-range-min"),s=t.find(".wpc-filters-range-max"),n=t.find(".wpc-filters-range-slider-control");var a=parseFloat(i.val()),l=parseFloat(s.val()),r=n.slider("option","min"),c=n.slider("option","max");a===r&&i.attr("disabled",!0),l===c&&s.attr("disabled",!0);let o=t.parents(wpcWidgetContainer),p=o.data("set"),d=!1;if(p>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(p)&&(d=!0),wpcAjax||d){e.preventDefault();let f=t.serialize();wpcSendFilterRequest(t.attr("action")+"?"+f,o,d),i.attr("disabled",!0),s.attr("disabled",!0)}else e.originalEvent&&t.trigger("submit")}}function wpcSendFilterRequest(link,widget,applyButtonMode,onComplete){onComplete=void 0!==onComplete&&onComplete,removeElement($(".wpc-front-error"));let requestParams={};requestParams.flrt_ajax_link=link,requestParams.wpcAjaxAction="filter";let setId=widget.data("set"),widgetClass="wpc-filter-set-"+setId,targetPostsContainer=wpcPostContainers.default;void 0!==wpcPostContainers[setId]&&(targetPostsContainer=wpcPostContainers[setId]),applyButtonMode&&$("body").hasClass("wpc_show_bottom_widget")&&window.innerWidth<=wpcMobileWidth&&(applyButtonMode=!1),$.ajax({method:"POST",data:requestParams,url:link,dataType:"html",beforeSend:function(){wpcWaitCursor&&$("html, body").css("cursor","wait");let e=$(widget).find(".wpc-filters-apply-button");e.removeClass("wpc-posts-loaded");let t=e.attr("href");e.attr("href",link),e.data("href",t),applyButtonMode?wpcLockApplyButton(setId):wpcShowSpinner()},complete:function(){!1!==onComplete&&eval(onComplete+"(setId)"),wpcWaitCursor&&$("html, body").css("cursor","auto"),wpcInitiateAll(),applyButtonMode?wpcUnlockApplyButton(setId):wpcHideSpinner()},success:function(e){if(void 0!==e){let t=$(e='<div class="responseWrapper">'+e+"</div>"),i=t.find(targetPostsContainer),s=t.find("#wpc-seo-rule-id").data("seoruleid"),n=t.find(".wpc-filters-main-wrap").hasClass("wpc-filter-request");if(toReplaceSEO=!!(currentState=s>0)||!!prevState,applyButtonMode){wpcReloadFiltersWidget(t,widgetClass);return}if(i.length>0&&wpcFilterFront.wpcAjaxEnabled&&wpcQueryOnThePageSets.includes(setId)){if(n?$("body").addClass("wpc_is_filter_request"):$("body").removeClass("wpc_is_filter_request"),$(targetPostsContainer).html(i.html()),$(widget).find(".wpc-filters-apply-button").addClass("wpc-posts-loaded"),toReplaceSEO){let a=t.find("title").text(),l=t.find('link[rel="canonical"]').attr("href");if(i.find("h1").length<1&&t.find("h1").length>0&&$("h1")[0].replaceWith(t.find("h1")[0]),i.find(".wpc-page-seo-description").length<1){let r=t.find(".wpc-page-seo-description"),c=$(".wpc-page-seo-description");r.length>0&&c.length>0&&$(".wpc-page-seo-description")[0].replaceWith(r[0])}void 0!==a&&""!==a&&$(document).attr("title",a),handleMetaTag("description",e),handleMetaTag("robots",e),void 0!==l&&""!==l?$('link[rel="canonical"]').length>0?$('link[rel="canonical"]').attr("href",l):$("head").append('<link rel="canonical" href="'+l+'" />'):$('link[rel="canonical"]').length>0&&$('link[rel="canonical"]').remove()}if(i.find(".wpc-open-button-"+setId).length<1){let o=t.find(".wpc-open-button-"+setId+" .wpc-button-inner");o.length>0&&$(".wpc-open-button-"+setId).each(function(e,t){if($(this).parent("div").hasClass("wpc-filters-main-wrap"))return!0;$(this).find(".wpc-button-inner").replaceWith(o[0])})}window.history.pushState({wpcHandler:"wpcFilterEverything"},null,link),prevState=currentState}else 0===$(targetPostsContainer).length&&wpcFilterFront.wpcAjaxEnabled&&alert(noPostsContainerMsg);let p=t.find("."+widgetClass).find(".wpc-posts-found").data("found");p=parseFloat(p),wpcReloadChips(t),wpcReloadSorting(t),wpcReloadFiltersWidget(t,widgetClass),$(document).trigger("ready"),$(window).trigger("scroll"),$(window).trigger("resize"),$(window).trigger("lazyshow"),wpcFixWoocommerceOrder();let d=!1;setId>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(setId)&&(d=!0),!wpcIsMobile&&wpcAutoScroll&&(p<wpcPostsPerPage[setId]||d)&&$(targetPostsContainer).length>0&&$("body, html").animate({scrollTop:$(targetPostsContainer).offset().top-wpcAutoScrollOffset}),"undefined"!=typeof elementorFrontend&&(i.hasClass("elementor-element")?$(targetPostsContainer+".elementor-element").each(function(){elementorFrontend.elementsHandler.runReadyTrigger($(this))}):$(targetPostsContainer+" .elementor-element").each(function(){elementorFrontend.elementsHandler.runReadyTrigger($(this))}))}},error:function(e){wpcHideSpinner();let t=$(widget).find(".wpc-filters-apply-button"),i=t.data("href");t.attr("href",i)}})}function handleMetaTag(e,t){let i=$(t).find('meta[name="'+e+'"]').attr("content");void 0!==i?$('meta[name="'+e+'"]').length>0?$('meta[name="'+e+'"]').attr("content",i):$("head").append('<meta name="'+e+'" content="'+i+'" />'):$('meta[name="'+e+'"]').length>0&&$('meta[name="'+e+'"]').remove()}function wpcFixWoocommerceOrder(){$(".woocommerce-ordering").on("change","select.orderby",function(){$(this).closest("form").submit()})}function wpcReloadFiltersWidget(e,t){!0===wpcIsMobile&&"yes"===wpcFilterFront.showBottomWidget?$(wpcWidgetContainer).each(function(t,i){let s=$(i).data("set"),n=".wpc-filter-set-"+s,a=e.find(n+" .wpc-filters-scroll-container"),l=e.find(n+" .wpc-filters-found-posts");if(a.length>0&&$(n).find(".wpc-filters-scroll-container").replaceWith(a),l.length>0&&$(n).find(".wpc-filters-found-posts").replaceWith(l),wpcApplyButtonSets.includes(s)){let r=$(n+" .wpc-filters-submit-button").attr("href");""!==r&&$(".wpc-filters-widget-controls-container .wpc-filters-submit-button").attr("href",r)}}):$(wpcWidgetContainer).each(function(t,i){let s=".wpc-filter-set-"+$(i).data("set"),n=e.find(s);n.length>0&&$(s).replaceWith(n)})}function wpcReloadSorting(e){let t=e.find(".wpc-sorting-form");if(t.length<1)return;let i=$(".wpc-sorting-form");t.length>0&&t.each(function(e,t){i[e].replaceWith(t)})}function wpcReloadChips(e){let t=$(".wpc-filter-chips-list");!(t.length<1)&&t.each(function(t,i){if((!0===wpcIsMobile&&"yes"!==wpcFilterFront.showBottomWidget||!1===wpcIsMobile)&&$(this).parent("div").hasClass("wpc-inner-widget-chips-wrapper"))return!0;let s=".wpc-filter-chips-"+$(i).data("setcount"),n=e.find(s);n.length>0&&$(s).replaceWith(n)})}$("#wpc-seo-rule-id").data("seoruleid")>0&&(prevState=!0),$(document).on("click",'.wpc-filter-content input[type="radio"],.wpc-filter-content input[type="checkbox"]',function(e){let t=$(this).data("wpc-link"),i=$(this).parents(wpcWidgetContainer),s=i.data("set"),n=!1;s>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(s)&&(n=!0),wpcAjax||n?(e.preventDefault(),wpcSendFilterRequest(t,i,n)):location.href=t}),$(document).on("change",".wpc-orderby-select",function(){let e=$(this).parents("form.wpc-sorting-form"),t="";t="?"+e.serialize();let i=e.attr("action")+t;wpcFilterFront.wpcAjaxEnabled?$(".wpc-filters-main-wrap").each(function(e,t){let s=$(t);wpcSendFilterRequest(i,s,!1)}):(e.attr("action",i),e.submit())}),$(document).on("change",".wpc-filter-content select",function(e){var t=$(this).find("option:selected").data("wpc-link");let i=$(this).parents(wpcWidgetContainer),s=i.data("set"),n=!1;s>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(s)&&(n=!0),wpcAjax||n?(e.preventDefault(),wpcSendFilterRequest(t,i,n)):location.href=t}),$(document).on("click",".wpc-filter-chip a",function(e){let t=$(this).attr("href"),i=$(this).parents(".wpc-filter-chips-list").data("set"),s=$(".wpc-filter-set-"+i),n=!1;if(i>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(i)&&$(this).parents(".wpc-filter-set-"+i).length>0&&(n=!0),!wpcAjax&&!n)return!0;e.preventDefault(),wpcSendFilterRequest(t,s,n)}),$(document).on("click","a.wpc-filters-submit-button",function(e){if($(this).hasClass("on-hold"))return e.preventDefault(),!1;let t=$(this).attr("href"),i=$(this).parents(".wpc-filters-main-wrap").data("set"),s=$(".wpc-filter-set-"+i);if(!(wpcAjax&&wpcQueryOnThePageSets.includes(i)))return!0;e.preventDefault(),wpcSendFilterRequest(t,s,!1)}),$(document).on("click","a.wpc-search-clear-icon",function(e){let t=$(this).attr("href"),i=$(this).parents(".wpc-filters-main-wrap").data("set"),s=$(".wpc-filter-set-"+i),n=!1;return!wpcAjax||(e.preventDefault(),wpcSendFilterRequest(t,s,n),!1)}),$(document).on("change",".wpc-search-field",function(e){let t=$(this).parents(".wpc-filter-search-form"),i=t.parents(wpcWidgetContainer),s=i.data("set"),n=!1;if(s>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(s)&&(n=!0),wpcAjax||n){let a=t.serialize();return wpcSendFilterRequest(t.attr("action")+"?"+a,i,n),!1}t.submit()}),$(document).on("submit",".wpc-filter-search-form",function(e){let t=$(this),i=t.parents(wpcWidgetContainer),s=i.data("set"),n=!1;if(s>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(s)&&(n=!0),wpcAjax||n){let a=t.serialize();return wpcSendFilterRequest(t.attr("action")+"?"+a,i,n),!1}t.submit()}),$(document).on("click","a.wpc-filters-reset-button",function(e){if($(this).hasClass("on-hold"))return e.preventDefault(),!1;let t=$(this).attr("href"),i=$(this).parents(".wpc-filters-main-wrap").data("set"),s=$(".wpc-filter-set-"+i);if(!wpcAjax)return!0;e.preventDefault(),wpcQueryOnThePageSets.includes(i)?wpcSendFilterRequest(t,s,!1):wpcSendFilterRequest(t,s,!0)}),$(document).on("click","i.wpc-toggle-children-list",function(){let e=$(this).data("tid"),t=$(this).parent(".wpc-term-item-content-wrapper").parent("li"),i=$(this).parents(".wpc-filters-section");t.hasClass("wpc-opened")?(t.removeClass("wpc-opened").addClass("wpc-closed"),setStatusCookie(-e,wpcHierachyListCookieName)):t.hasClass("wpc-closed")?(t.removeClass("wpc-closed").addClass("wpc-opened"),setStatusCookie(e,wpcHierachyListCookieName)):i.hasClass("wpc-filter-hierarchy-reverse")?(t.removeClass("wpc-opened").addClass("wpc-closed"),setStatusCookie(-e,wpcHierachyListCookieName)):(t.removeClass("wpc-closed").addClass("wpc-opened"),setStatusCookie(e,wpcHierachyListCookieName))}),$(document).on("click",".wpc-filters-overlay",function(){let e=$("body").data("set");wpcCloseFiltersContainer(e)}),$(document).on("change",'.wpc-filter-range-form input[type="number"]',function(e){let t=$(this).parents(".wpc-filter-range-form"),i=t.find(".wpc-filters-range-min"),s=t.find(".wpc-filters-range-max");var n=parseFloat(i.val()),a=parseFloat(s.val()),l=i.data("min"),r=s.data("max");t.hasClass("wpc-form-has-slider")&&t.find(".wpc-filters-range-slider-control").slider("option","values",[n,a]),n===l&&i.attr("disabled",!0),a===r&&s.attr("disabled",!0);let c=t.parents(wpcWidgetContainer),o=c.data("set"),p=!1;if(o>0&&wpcApplyButtonSets.length>0&&wpcApplyButtonSets.includes(o)&&(p=!0),wpcAjax||p){let d=t.serialize();wpcSendFilterRequest(t.attr("action")+"?"+d,c,p),i.attr("disabled",!1),s.attr("disabled",!1)}else t.submit()}),$(document).on("click",".wpc-open-close-filters-button",function(e){e.preventDefault();let t=$(this),i=t.data("wid"),s=$(".wpc-filter-set-"+i+" .wpc-filters-widget-content");s.is(":visible")?s.slideUp({duration:100,complete:function(){$(this).addClass("wpc-closed").removeClass("wpc-opened"),t.removeClass("wpc-opened"),wpcSetCookie(wpcWidgetStatusCookieName,null,{path:"/","max-age":2592e3})}}):s.slideDown({duration:100,complete:function(){$(this).addClass("wpc-opened").removeClass("wpc-closed"),t.addClass("wpc-opened"),wpcSetCookie(wpcWidgetStatusCookieName,i,{path:"/","max-age":2592e3})}})}),$(document).on("click",".wpc-widget-close-icon",function(e){e.preventDefault();let t=$(this).parents(wpcWidgetContainer).data("set");wpcCloseFiltersContainer(t)}),$(document).on("click",".wpc-filters-apply-button",function(e){e.preventDefault();let t=$(this).parents(wpcWidgetContainer),i=t.data("set"),s=$(".wpc-filter-set-"+i+" .wpc-filters-widget-content"),n=$(this).attr("href"),a=!$(this).hasClass("wpc-posts-loaded"),l="",r=!1;t.removeClass("wpc-container-opened"),$("html").removeClass("wpc-overlay-visible"),s.removeClass("wpc-filters-widget-opened"),$(".wpc-open-button-"+i+" .wpc-filters-open-widget").removeClass("wpc-opened"),wpcPopupCompatMode&&setTimeout(()=>{s.parents().each(function(e,t){"undefined"!==(l=(r=$(t)).data("wpczindex"))&&r.css("z-index",l),r.hasClass("wpc-force-visibility")&&r.removeClass("wpc-force-visibility")}),setTimeout(()=>{$(".wpc-was-invisible").css("opacity","1").removeClass("wpc-was-invisible")},300)},260),a&&(location.href=n)}),$(document).on("submit",".wpc-filter-range-form",function(e){submitSliderForm(e,$(this))}),$(document).on("click",".wpc-filter-content a",function(e){e.preventDefault();let t=$(this).closest("label").attr("for");$(this).closest("label").parent(".wpc-term-item-content-wrapper").parent(".wpc-term-item").find("#"+t).trigger("click")}),$(document).on("click",".wpc-filters-open-widget",function(e){e.preventDefault();let t=$(this).data("wid");wpcOpenContainer(t)}),$(document).on("click",".wpc-filters-close-button",function(e){e.preventDefault();let t=$(this).parents(wpcWidgetContainer),i=t.data("set");if(wpcAjax&&wpcFilterFront.wpcAjaxEnabled){let s=$(this).attr("href"),n=$(".wpc-filter-set-"+i+" .wpc-filters-apply-button").attr("href");if(s!==n){wpcSendFilterRequest(s,t,!1,"wpcCloseFiltersContainer");return}}wpcCloseFiltersContainer(i)}),$(document).on("click","a.wpc-toggle-a",function(e){e.preventDefault();let t=$(this).data("fid"),i=$(".wpc-filters-section-"+t);i.hasClass("wpc-show-more")?(i.removeClass("wpc-show-more").addClass("wpc-show-less"),setStatusCookie(-t,wpcMoreLessCookieName)):i.hasClass("wpc-show-less")?(i.removeClass("wpc-show-less").addClass("wpc-show-more"),setStatusCookie(t,wpcMoreLessCookieName)):i.hasClass("wpc-filter-has-selected")||i.hasClass("wpc-show-more-reverse")?(i.removeClass("wpc-show-more").addClass("wpc-show-less"),setStatusCookie(-t,wpcMoreLessCookieName)):(i.removeClass("wpc-show-less").addClass("wpc-show-more"),setStatusCookie(t,wpcMoreLessCookieName))}),$(document).on("click",".wpc-filter-title button",function(e){e.preventDefault();let t=$(this).parents(".wpc-filters-section"),i=t.data("fid");t.hasClass("wpc-opened")?(t.removeClass("wpc-opened").addClass("wpc-closed"),setStatusCookie(-i,wpcStatusCookieName)):t.hasClass("wpc-closed")?(t.removeClass("wpc-closed").addClass("wpc-opened"),setStatusCookie(i,wpcStatusCookieName)):t.hasClass("wpc-filter-has-selected")||t.hasClass("wpc-filter-collapsible-reverse")?(t.removeClass("wpc-opened").addClass("wpc-closed"),setStatusCookie(-i,wpcStatusCookieName)):(t.removeClass("wpc-closed").addClass("wpc-opened"),setStatusCookie(i,wpcStatusCookieName))}),$(window).resize(function(){window.innerWidth<=wpcMobileWidth?(wpcIsMobile=!0,"yes"===wpcFilterFront.showBottomWidget&&(wpcAjax=!0)):(wpcAjax=wpcFilterFront.wpcAjaxEnabled,wpcIsMobile=!1),"yes"===wpcUseSelect2&&$(wpcWidgetContainer).each(function(e,t){let i="wpc-filter-set-"+$(t).data("set");wpcInitSelect2(i)})}),$.support.pjax&&$(document).on("pjax:end",function(){setTimeout(()=>{wpcInitiateAll()},300)}),$(document).ready(function(){wpcInitiateAll()}),$(document).on("input",".wpc-search-field",function(e){let t=$(this).val().toString().toLowerCase(),i=$(this).parents(".wpc-filters-section");""!==t?i.addClass("wpc-search-active"):i.removeClass("wpc-search-active")}),$(document).on("input",".wpc-filter-search-field",function(e){let t=$(this).val().toString().toLowerCase(),i=$(this).parents(".wpc-filters-section"),s=i.data("fid");""!==t?($(".wpc-filter-search-wrapper-"+s+" .wpc-search-clear").show(),i.addClass("wpc-search-active")):($(".wpc-filter-search-wrapper-"+s+" .wpc-search-clear").hide(),i.removeClass("wpc-search-active")),$(".wpc-filters-list-"+s+" li").each(function(e,i){let s=$(i);$(i).find("label a").text().toLowerCase().indexOf(t)>-1?s.addClass("showli"):s.removeClass("showli")})}),$(document).on("click",".wpc-search-clear",function(e){e.preventDefault();$(this).parent(".wpc-filter-search-wrapper").find(".wpc-filter-search-field").val("").trigger("input")}),$.fn.wpcInitSlider=function(e){let t=e.find(".wpc-filters-range-min"),i=e.find(".wpc-filters-range-max"),s=e.find(".wpc-filters-range-slider-control"),n=parseFloat(t.attr("step")),a=parseFloat(t.data("min")),l=parseFloat(i.data("max")),r=parseFloat(t.val()),c=parseFloat(i.val());s.slider({min:a,max:l,values:[r,c],range:!0,step:n,slide:function(e,s){let n=s.values[0],a=s.values[1];t.val(n),i.val(a)},change:function(t){submitSliderForm(t,e)}}),e.submit(function(e){0===$(this).serialize().length&&(e.preventDefault(),window.location.assign(window.location.pathname))})},window.addEventListener("popstate",function(e){null!==e.state&&e.state.hasOwnProperty("wpcHandler")&&"wpcFilterEverything"===e.state.wpcHandler&&window.location.reload(!0)}),$.fn.tipTip=function(e){var t={activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},i=$.extend(t,e);if($("#tiptip_holder").length<=0){var s=$('<div id="tiptip_holder" style="max-width:'+i.maxWidth+';"></div>'),n=$('<div id="tiptip_content"></div>'),a=$('<div id="tiptip_arrow"></div>');$("body").append(s.html(n).prepend(a.html('<div id="tiptip_arrow_inner"></div>')))}else var s=$("#tiptip_holder"),n=$("#tiptip_content"),a=$("#tiptip_arrow");return this.each(function(){var e=$(this);if(i.content)var t=i.content;else var t=e.attr(i.attribute);if(""!=t){i.content||e.removeAttr(i.attribute);var l=!1;function r(){i.enter.call(this),n.html(t),s.hide().removeAttr("class").css("margin","0"),a.removeAttr("style");var r=parseInt(e.offset().top),c=parseInt(e.offset().left),o=parseInt(e.outerWidth()),p=parseInt(e.outerHeight()),d=s.outerWidth(),f=s.outerHeight(),w=Math.round((o-d)/2),h=Math.round((p-f)/2),u=Math.round(c+w),m=Math.round(r+p+i.edgeOffset),v="",g="",C=Math.round(d-12)/2;"bottom"==i.defaultPosition?v="_bottom":"top"==i.defaultPosition?v="_top":"left"==i.defaultPosition?v="_left":"right"==i.defaultPosition&&(v="_right");var b=w+c<parseInt($(window).scrollLeft()),_=d+c>parseInt($(window).width());b&&w<0||"_right"==v&&!_||"_left"==v&&c<d+i.edgeOffset+5?(v="_right",g=Math.round(f-13)/2,C=-12,u=Math.round(c+o+i.edgeOffset),m=Math.round(r+h)):(_&&w<0||"_left"==v&&!b)&&(v="_left",g=Math.round(f-13)/2,C=Math.round(d),u=Math.round(c-(d+i.edgeOffset+5)),m=Math.round(r+h));var y=r+p+i.edgeOffset+f+8>parseInt($(window).height()+$(window).scrollTop()),x=r+p-(i.edgeOffset+f+8)<0;y||"_bottom"==v&&y||"_top"==v&&!x?("_top"==v||"_bottom"==v?v="_top":v+="_top",g=f,m=Math.round(r-(f+5+i.edgeOffset))):(x|("_top"==v&&x)||"_bottom"==v&&!y)&&("_top"==v||"_bottom"==v?v="_bottom":v+="_bottom",g=-12,m=Math.round(r+p+i.edgeOffset)),"_right_top"==v||"_left_top"==v?m+=5:("_right_bottom"==v||"_left_bottom"==v)&&(m-=5),("_left_top"==v||"_left_bottom"==v)&&(u+=5),a.css({"margin-left":C+"px","margin-top":g+"px"}),s.css({"margin-left":u+"px","margin-top":m+"px"}).attr("class","tip"+v),l&&clearTimeout(l),l=setTimeout(function(){s.stop(!0,!0).fadeIn(i.fadeIn)},i.delay)}function c(){i.exit.call(this),l&&clearTimeout(l),s.fadeOut(i.fadeOut)}"hover"==i.activation?(e.hover(function(){r()},function(){i.keepAlive&&s.is(":hover")||c()}),i.keepAlive&&s.hover(function(){},function(){c()})):"focus"==i.activation?e.focus(function(){r()}).blur(function(){c()}):"click"==i.activation&&(e.click(function(){return r(),!1}).hover(function(){},function(){i.keepAlive||c()}),i.keepAlive&&s.hover(function(){},function(){c()}))}})}}(jQuery);